//
//  main.c
//  c语言test
//
//  Created by Song on 2017/12/15.
//  Copyright © 2017年 Song. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct list_node {
    int data;
    struct list_node *next;
};

typedef struct list_node list_single;

// 创建节点的函数
list_single *creat_list_node(int data11) {
    list_single *node = NULL;
    node = (list_single *)malloc(sizeof(list_single)); // 分配内存空间
    if (node == NULL) {
        printf(" - wrong - ");
    }
    memset(node,0,sizeof(list_single)); // 清理
    node->data = data11;
    node->next = NULL;
    free(node);
    return node;
}

int main(int argc, const char * argv[]) {
    int data = 10;
    list_single *node_ptr = creat_list_node(data);
    printf("node_ptr->data = %d \n",node_ptr->data);
//    printf("node_ptr->next = %d \n",node_ptr->next);
    return 0;
}




